using System.Collections.Generic;
using System.Linq;
using System;

namespace MyUtils
{
	public interface IDictionaryObject
	{
		object this[string propertyName] { get; set; }

		T Get<T>(string propertyName);

		/// <summary>
		/// Cache lambda to custom property. Weak by key (owner class).
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="propertyName"></param>
		/// <param name="factory"></param>
		/// <returns></returns>
		T Get<T>(string propertyName, Func<T> factory) where T : class;

		T Set<T>(string propertyName, T value);
	}
}